package com.xy.util;

public class ExceptionUtil {

	public static String getExceptionMessage(Throwable t) {
		return getExceptionMessage(t, null);
	}

	public static String getExceptionMessage(Throwable t, String defaultMessage) {
		if (t != null) {
			return t.getMessage() != null ? t.getMessage() : t.toString();
		}
		return defaultMessage != null ? defaultMessage : "";
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {

	}

}
